home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / var / lib / dpkg / info / fontconfig.postinst < prev    next >
Encoding:
Text File  |  2010-04-17  |  1.7 KB  |  50 lines

  1. #!/bin/sh
  2.  
  3. set -e
  4.  
  5. if [ "$1" = triggered ]; then
  6.   # Force regeneration of all fontconfig cache files.
  7.   mkdir -p /var/cache/fontconfig
  8.   fc-cache -s -v 1>/var/log/fontconfig.log 2>&1 || printf "fc-cache failed.\nSee /var/log/fontconfig.log for more information.\n"
  9.   exit 0
  10. fi
  11.  
  12. if [ "$1" = configure ]; then
  13.   # If defoma is installed, ensure Defoma subst file exists, with some default substitutions
  14.     if [ -x "`which defoma-subst`" ]; then
  15.     if ! defoma-subst check-rule fontconfig; then
  16.         defoma-subst new-rule fontconfig \
  17.         'serif --GeneralFamily,* Roman --Shape Serif Upright --Weight Medium' \
  18.         'sans-serif --GeneralFamily,* SansSerif --Shape NoSerif Upright --Weight Medium' \
  19.         'monospace --Width,* Fixed --GeneralFamily,2 Typewriter --Shape Upright --Weight Medium'
  20.     fi
  21.     fi
  22. fi
  23.  
  24. # Automatically added by dh_installdefoma
  25. if [ "$1" = "configure" ]; then
  26.     if [ -x "`which defoma-app 2>/dev/null`" ]; then
  27.         defoma-app update fontconfig
  28.     fi
  29. fi
  30. # End automatically added section
  31.   
  32.  
  33. if [ "$1" = configure ]; then
  34.   if dpkg --compare-versions "$2" lt 2.4.0-1; then
  35.   printf "Cleaning up old fontconfig caches... "
  36.   for dir in /usr/share/fonts /var/lib/defoma/fontconfig.d /usr/X11R6/lib/X11/fonts /usr/local/share/fonts ; do
  37.       if [ -d $dir ]; then
  38.         find $dir -name fonts.cache-1 -exec rm -f \{\} \;
  39.         find $dir -depth -mindepth 1 -type d -exec rmdir --ignore-fail-on-non-empty \{\} \;
  40.     fi
  41.   done
  42.   printf "done.\n"
  43.   fi
  44.   # Force regeneration of all fontconfig cache files.
  45.   mkdir -p /var/cache/fontconfig
  46.   printf "Regenerating fonts cache... "
  47.   fc-cache -s -f -v 1>/var/log/fontconfig.log 2>&1 || (printf "failed.\nSee /var/log/fontconfig.log for more information.\n"; exit 1)
  48.   printf "done.\n"
  49. fi
  50.